<%--
  @desc: 应用系统角色新增
  @author: chenw
  @create: 2014-4-29 下午 15:32
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style type="text/css">
    .pageFormContent .textInput {
        width: 220px;
    }
    .pageFormContent .fix_p { width: 310px; }
    .gray {
        color: gray;
    }
</style>
<script type="text/javascript">
    /**
     * 状态改变 操作内容
     **/
    function inputType() {
        var operate_content = "用户id:" + "${user.id} " + "状态更新为:" + $("#txt_user_status option:selected").html();
        alert(operate_content);
        $("#operate_content").val(operate_content)
    }
</script>
<div class="pageContent">
    <form id="pagerForm" method="post" action="<c:url value='/sys/user/save'/>" class="pageForm required-validate"
          onsubmit="return validateCallback(this,callbackForSubmit)" rel="dlg_sys_user_edit">
        <div class="pageFormContent" style="height: 160px;">
            <p>
                <label for="txt_user_login_id" class="required">登录账号</label>
                <input id="txt_user_login_id" type="text" name="loginId" class="required" maxlength="50" value="${user.loginId}" readonly=readonly/>
            </p>
            <p>
                <label for="txt_user_real_name">真实姓名</label>
                <input id="txt_user_real_name" type="text" name="realName" class="required" maxlength="300" value="${user.realName}"
                       readonly=readonly/>
            </p>
            <p class="fix_p">
                <label for="txt_user_status">状态</label>
                <select id="txt_user_status" name="status" class="combox" onchange="inputType()">
	                <c:if test="${user.status == -1}">
		                <option value="-1" selected="selected">锁定</option><option value="0">正常</option><option value="1">禁用</option><option value="2">审核</option>
	                </c:if>
	                <c:if test="${user.status == 0}">
		                <option value="-1">锁定</option><option value="0" selected="selected">正常</option><option value="1">禁用</option><option value="2">审核</option>
	                </c:if>
	                <c:if test="${user.status == 1}">
		                <option value="-1">锁定</option><option value="0">正常</option><option value="1" selected="selected">禁用</option><option value="2">审核</option>
	                </c:if>
	                <c:if test="${user.status == 2}">
		                <option value="-1">锁定</option><option value="0">正常</option><option value="1">禁用</option><option value="2" selected="selected">审核</option>
	                </c:if>
                </select>
            </p>
            <p>
                <label for="txt_user_change_cause" class="required">更改原因</label>
                <textarea id="txt_user_change_cause" name="case_content" rows="3" class="required" maxlength="100"></textarea>
            </p>
            <input type="hidden" name="user.id" value="${user.id}"/>
            <input type="hidden" name="userName" value="${user.realName}"/>
            <input type="hidden" name="userId" value="${user.id}"/>
            <input type="hidden" name="operate_content" value="" id="operate_content">
            <input type="hidden" name="sort" value="${user.sort}"/>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">更新</button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">取消</button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<script type="text/javascript">
    function callbackForSubmit(resp, st, xhr) {
        if (resp && resp.succ) {
            alertMsg.info("用户状态更新成功！");
            $.pdialog.closeCurrent();
            navTab.reloadFlag('page_sys_user_list')
        } else {
            alertMsg.info(resp.msg + "!");
        }
    }
</script>